﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Timers;
using Reborn_Server.App1AppHandler;

namespace App1AppHandler
{
    public class Corpse : Loot,ICorpse
    {
        public List<Loot> LootToDrop;
        public Corpse(AppHandler2 appHandler) : base (appHandler)
        {
            LootToDrop = new List<Loot>();
            this.timerDestroyInterval = 5 * 60 * 1000;
            this.Description = "Double click to loot";
        }
        protected override void timerDestroy_Elapsed(object source, ElapsedEventArgs e)
        {
            //This will roll & remove the corpse because of the -1 character ID
            MainApp.Corpse_Roll(null, MapID, Instance, MapX, MapY, GameUID);
        }
        public List<Loot> RemoveLoot() 
        {
            List<Loot> itemsToRemove = new List<Loot>();
           
            foreach (Loot loot in LootToDrop)
            {
                itemsToRemove.Add(loot);
            }
            LootToDrop.Clear();

            return itemsToRemove;
        }

    }
}
